﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JacOS
{
    class JacOS
    {
        public static uint ParseNum(string text, uint start, uint end, uint defualt)
        {
            uint a;
            for (a = start; a <= end; a++)
            {
                if (a.ToString() == text)
                {
                    return a;
                }
            }
            return defualt;
        }

        public static uint ReadNum(uint start, uint end, uint defualt)
        {
            uint a;
            string UserInput;
            UserInput = Console.ReadLine();
            for (a = start; a <= end; a++)
            {
                if (a.ToString() == UserInput)
                {
                    return a;
                }
            }
            return defualt;
        }

        public static string seperate(string input, int length)
        {
            var count = 0;
            string character;
            string output = "";
            while (count < length)
            {
                character = input[count].ToString();
                output = output + character;
                count = count + 1;

            }
            return output;
        }

        public static string rseperate(string input, int start, int end)
        {
            int count = 0;
            string character = "";
            string output = "";
            while (end >= start)
            {
                character = input[start].ToString();
                output = output.Insert(count, character);
                start = start + 1;
                count = count + 1;
            }
            return output;
        }

        public static void WriteAt(int left = 1, int top = 1, string s = "JacOS")
        {
            int currentLeft = Console.CursorLeft;
            int currentTop = Console.CursorTop;
            Console.CursorVisible = false;//Hide cursor
            Console.SetCursorPosition(left, top);
            Console.Write(s);
            Console.SetCursorPosition(currentLeft, currentTop);
            Console.CursorVisible = true;//Show cursor back
        }

        public static string GatherArgs(string arg = "")
        {
            if (arg == "a")
                return Variables.a;
            if (arg == "b")
                return Variables.b;
            if (arg == "c")
                return Variables.c;
            if (arg == "d")
                return Variables.d;
            if (arg == "e")
                return Variables.e;
            if (arg == "f")
                return Variables.f;
            if (arg == "g")
                return Variables.g;
            if (arg == "h")
                return Variables.h;
            if (arg == "i")
                return Variables.i;
            if (arg == "j")
                return Variables.j;
            if (arg == "k")
                return Variables.k;
            if (arg == "l")
                return Variables.l;
            if (arg == "m")
                return Variables.m;
            if (arg == "n")
                return Variables.n;
            if (arg == "o")
                return Variables.o;
            if (arg == "p")
                return Variables.p;
            if (arg == "q")
                return Variables.q;
            if (arg == "r")
                return Variables.r;
            if (arg == "s")
                return Variables.s;
            if (arg == "t")
                return Variables.t;
            if (arg == "u")
                return Variables.u;
            if (arg == "v")
                return Variables.v;
            if (arg == "w")
                return Variables.w;
            if (arg == "x")
                return Variables.x;
            if (arg == "y")
                return Variables.y;
            if (arg == "z")
                return Variables.z;
            else
                return arg;


        }

    }
}
